//
// Created by baoch on 2024/12/18.
//
#include <stdio.h>
struct shu
{
    int data;
    struct shu * next;
};
struct shu * HEAD()
{
    struct shu* head = (struct shu*)malloc(sizeof(struct shu));
    head -> data = 0;
    head -> next = NULL;
    return head;
}
int main()
{
    int n;
    scanf("%d",&n);
    int arr[n];
    for(int i = 0;i < n;i++)
    {
        scanf("%d ",&arr[i]);
    }
    struct shu* head = HEAD();
    struct shu* p = head;
    for(int i = 0;i < n;i++)
    {
        struct shu* newnode = (struct shu*)malloc(sizeof(struct shu));
        newnode -> data = arr[i];
        p -> next = newnode;
        p = p -> next;
    }
    int sum = 0;
    struct shu* tail = head;
    while(tail != NULL)
    {
        sum =sum + (tail -> data);
        tail = tail -> next;
    }
    printf("%d",sum);

    return 0;
}